#!usr/bin/env python  
# -*- coding:utf-8 -*-

from django.db import models


class SiteSetting(models.Model):
    """
    博客统计
    """
    title = models.CharField(max_length=64, verbose_name="网站标题", default="")
    keywords = models.CharField(max_length=128, verbose_name="关键字", default="")
    description = models.TextField(verbose_name="描述文字", default="")
    push_url = models.CharField(max_length=128, verbose_name="熊掌号URL")
    signup = models.BooleanField(verbose_name="开启注册", default=False)

    class Meta:
        verbose_name = verbose_name_plural = '基本设置'

    def __str__(self):
        return self.title


class BlogCounts(models.Model):
    """
    博客统计
    """
    create_date = models.DateTimeField(verbose_name="创建时间", auto_now_add=True)
    url = models.URLField(max_length=64, blank=False, verbose_name="访问链接")
    counts = models.IntegerField(verbose_name="访问次数")

    class Meta:
        verbose_name = verbose_name_plural = '博客统计'


class NavUrlSetting(models.Model):
    link = models.URLField(max_length=64, verbose_name="地址")
    name = models.CharField(max_length=32, verbose_name="导航栏名称")
    index = models.IntegerField(default=0, verbose_name="排序")

    class Meta:
        verbose_name = verbose_name_plural = '导航栏配置'
